package com.igeek.base.ch0711.Dome1;

import java.util.Scanner;

/**
 * @Description TODO
 * @Author chenmin
 * @Date 2024/7/11 15:11
 */
public class GradeText {
    public static void main(String[] args) {
        Scanner input= new Scanner(System.in);
        System.out.println("请输入Java成绩:");
        float a =input.nextFloat();
        System.out.println("请输入C#成绩:");
        float b =input.nextFloat();
        System.out.println("请输入数据库成绩:");
        float c =input.nextFloat();

        //无参构造
        Grade grade = new Grade();
        grade.setJava(a);
        grade.setC(b);
        grade.setSql(c);
        System.out.println("----------无参------------");
        System.out.println("三个科目的平均值为："+grade.avg());
        System.out.println("三个科目的总分为："+grade.sum());

        //有参构造
        Grade grade1 =new Grade(a,b,c);
        System.out.println("----------有参------------");
        System.out.println("三个科目的平均值为："+grade1.avg());
        System.out.println("三个科目的总分为："+grade1.sum());



    }
}
